#ifndef CVI_OTP_DEFINES_H
#define CVI_OTP_DEFINES_H

typedef enum CVI_OTP_AREA {
    CVI_OTP_AREA_HASH0_PUBLIC = 0,
    CVI_OTP_AREA_LOADER_EK,
    CVI_OTP_AREA_LAST
} CVI_OTP_AREA_E;

typedef enum CVI_OTP_CONFIG {
    CVI_OTP_CONFIG_SECUREBOOT = CVI_OTP_AREA_LAST + 1,
    CVI_OTP_CONFIG_RESERVE_SEGMENT,
    CVI_OTP_CONFIG_LAST
} CVI_OTP_CONFIG_E;

static const char *const otp_areas[] = {
    [CVI_OTP_AREA_HASH0_PUBLIC] = "HASH0_PUBLIC",
    [CVI_OTP_AREA_LOADER_EK] = "LOADER_EK",
    [CVI_OTP_CONFIG_SECUREBOOT] = "SECUREBOOT",
    [CVI_OTP_CONFIG_RESERVE_SEGMENT] = "RESERVE_SEGMENT",
};

// for secure boot sign
#define CVI_OTP_TEE_SCS_ENABLE_SHIFT                    2
#define CVI_OTP_ROOT_PUBLIC_KEY_SELECTION_SHIFT         20
// for secure boot encryption
#define CVI_OTP_BOOT_LOADER_ENCRYPTION                  6
#define CVI_OTP_LDR_KEY_SELECTION_SHIFT                 23

typedef enum CVI_OTP_SECUREBOOT {
    CVI_OTP_SECUREBOOT_DISABLE = 0,
    CVI_OTP_SECUREBOOT_SIGN,
    CVI_OTP_SECUREBOOT_SIGN_ENCRYPT,
} CVI_OTP_SECUREBOOT_E;

#endif
